﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp12
{
    class Program
    {
        static void Main(string[] args)
        {
            DateTime dt = DateTime.Now;
            Console.WriteLine("请输入年份：");
            int str = int.Parse(Console.ReadLine());

            Console.WriteLine("请输入你生日的月份：");
            int str1 = int.Parse(Console.ReadLine());

            Console.WriteLine("请输入生日的日期：");
            int str2 = int.Parse(Console.ReadLine());

            Console.WriteLine("你的生日是：{0}月{1}号",str1,str2);
            DateTime dt2 = new DateTime(str,str1,str2);
            TimeSpan ts = dt2 - dt;
            Console.WriteLine("间隔天数为：{0}日",ts);

            Console.WriteLine();
            Console.WriteLine();

            Console.WriteLine("当前日期为：{0}", dt);
            Console.WriteLine("当前时本月的第{0}天", dt.Day);
            Console.WriteLine("当前是：{0}", dt.DayOfWeek);
            Console.WriteLine("当前是本年度第{0}天", dt.DayOfYear);
            Console.WriteLine("30 天后的日期是{0}", dt.AddDays(30));



            //字符串
            Console.WriteLine();
            Console.WriteLine();


            Console.WriteLine("输入你想要写的字符串省的等下又找不到（别墨迹）：");
            string bbc = Console.ReadLine();
            Console.WriteLine("字符串的长度为：" + bbc.Length);
            Console.WriteLine("字符串中第一个字符为：" + bbc[0]);
            Console.WriteLine("字符串中最后一个字符为：" + bbc[bbc.Length - 1]);



        }
    }
}
